]> git.r.bdr.sh - rbdr/super-polarity/blobdiff - Super Polarity/SuperPolarity.cs
Implements polarity system
[rbdr/super-polarity] / Super Polarity / SuperPolarity.cs
index e5f565bd23d874bde0f6bb02e82b683e70f6cda3..b590079bf248f065530b48775c10083b6013c8c4 100644 (file)
@@ -26,7 +26,7 @@ namespace SuperPolarity
             SuperPolarity.graphics = new GraphicsDeviceManager(this);
             SuperPolarity.graphics.PreferMultiSampling = true;
             Content.RootDirectory = "Content";
-            ActorFactory.SetContentManager(Content);
+            ActorFactory.SetGame(this);
         }
 
         /// <summary>
@@ -38,6 +38,12 @@ namespace SuperPolarity
         protected override void Initialize()
         {
             base.Initialize();
+
+            InputController.RegisterEventForButton("changePolarity", Buttons.A);
+            InputController.RegisterEventForKey("changePolarity", Keys.Z);
+
+            InputController.RegisterEventForButton("shoot", Buttons.X);
+            InputController.RegisterEventForKey("shoot", Keys.X);
         }
 
         /// <summary>
@@ -51,6 +57,8 @@ namespace SuperPolarity
 
             Vector2 playerPosition = new Vector2(GraphicsDevice.Viewport.TitleSafeArea.X, GraphicsDevice.Viewport.TitleSafeArea.Y + GraphicsDevice.Viewport.TitleSafeArea.Height / 2);
 
+            ActorFactory.CreateShip(Ship.Polarity.Positive, new Vector2(200, 200));
+            ActorFactory.CreateShip(Ship.Polarity.Negative, new Vector2(400, 200));
             ActorFactory.CreateMainShip(playerPosition);
         }